import Request from '@/api/request/request';
import urls from '@/api/request/urls';

//获取验证码
export async function getVerifyCode(token: string) {
  return new Request(urls.API_URL_BACKSTAGE_VERIFYCODE, {
    token
  }).get();
}

//登录
export async function login(username: string, password: string, verifyCode: string, token: string) {
  const formObj = {
    // 封装要传递的表单数据
    username: username,
    password: password,
    verifyCode: verifyCode,
    token
  };
  return new Request(urls.API_URL_BACKSTAGE_ADMIN_LOGIN, null, {
    params: formObj
  }).post();
}
